<template>
  <div class="txmcontent">
    <div
      v-for="(item, index) in gtels"
      :key="index"
      style="
        width: 202px;
        height: 67.33px;
        display: flex;
        justify-content: center;
        align-items: center;
      "
    >
      <canvas :ref="'txm' + item"></canvas>
    </div>
  </div>
</template>
<script>
  import JsBarcode from 'jsbarcode'
  export default {
    name: 'Jsbarcode',
    props: {
      gtels: {
        default: [],
      },
    },
    watch: {
      gtels: function (n) {
        setTimeout(() => {
          n.forEach((e) => {
            JsBarcode(this.$refs['txm' + e], e, {
              format: 'code128',
              width: 1.4,
              height: 36,
              fontSize: '14',
              textMargin: 5,
              margin: 5,
              // output: "css",
              // bgColor: "#FFFFFF",
              // color: "#000000",
              // barWidth: "2",
              // barHeight: "49",
              // moduleSize: "5",
              // textMargin: "6",
              // posX: "10",
              // posY: "20",
              // showHRI: false,
              // addQuietZone: "1"
            })
          })
        })
      },
    },
  }
</script>
<style scoped>
  .txmcontent {
    width: 634px;
    background: #fff;
    flex-wrap: wrap;
    justify-content: space-between;
    display: flex;
    padding-top: 7px;
  }
</style>
